angular.module('imsApp').controller('copyScreenDetailController', ['$scope', '$rootScope', '$state', 'copyScreenManager','$uibModal', function ($scope, $rootScope, $state, copyScreenManager,$uibModal) {
    $scope.search = {
        campaignId:$state.params.campaignId
    }
    copyScreenManager.copyScreenDetail([$scope.search.campaignId], $scope.search).then(function (result) {
        $scope.copyScreenDetail = result.data.pageList;
    });

    $scope.upload=function (id) {
        var modalInstance = $uibModal.open({
            animation: true,
            size: 'normal',
            openedClass:"modal-open-normal",
            templateUrl: 'copyScreenLoad.html',
            controller: 'copyScreenAddModalController',
            resolve: {
                appId:function () {
                    return id;
                }
            }
        });
        modalInstance.result.then(function (result) {
            if(result=="ok"){
                setTimeout(function () {
                    $state.reload();
                },100)
            }
        })
    }

}]);

